let mysql = require('mysql')

let conn = mysql.createConnection(
  {
    host:'localhost',
    user:'root',
    passward:'',
    port:'3306',
    database:'myweb'
  }
)

conn.connect()

let sql = 'select * from goods'

conn.query(sql,function(err,res)
  {
    if(err){
      console.log('连接失败')
    }
    console.log(res)
  }
)
